/**
 * advertorialOrder模块接口列表
 */
import axios from '../http';
import base from './base'; // 导入接口域名列表
import qs from 'qs'; // 根据需求是否导入qs模块
import store from '../../store/index';

const mediaMall = {

	//软文列表查询数据
	busArticle(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/softText/findResourceSoftText?${param}`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	//软文收藏商品
	Collection(params) {
		// return axios.post(`${base.bd}/softText/updateByCollect`,params,{headers:{'Content-Type' : 'application/x-www-form-urlencoded'}})
		return axios.post(`${base.bd}/softText/updateByCollect`, qs.stringify(params), {
			headers: {
				'Content-Type': 'application/x-www-form-urlencoded'
			}
		})
	},
	//查询购物车数据
	shopCart(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/orderCartSoftText/findList`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	//删除购物车数据
	delShopCart(params) {
		let param = qs.stringify(params)
		return axios.post(`${base.bd}/orderCartSoftText/deleteById?${param}`)
	},
	//添加进购物车
	addShopCart(params) {
		let param = qs.stringify(params)
		return axios.post(`${base.bd}/orderCartSoftText/saveCart?${param}`)
	},
	// 点击查看内页跳转数据请求
	IdArticleData(params){
		let param = qs.stringify(params)
		// let token = JSON.parse(sessionStorage.getItem('store')).accToken
		let token = localStorage.getItem('token')
		return axios.get(`${base.bd}/softText/findResourceSoftText?${param}`,{headers:{"Authorization":token}})
	},
	// 软文资源结束================================================================================================================================================

	//自媒体查询数据
	zimArticle(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/selfMedia/findResourceSelfMedia?${param}`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	//收藏商品
	zimCollection(params) {
		// return axios.post(`${base.bd}/softText/updateByCollect`,params,{headers:{'Content-Type' : 'application/x-www-form-urlencoded'}})
		return axios.post(`${base.bd}/selfMedia/updateByCollect`, qs.stringify(params), {
			headers: {
				'Content-Type': 'application/x-www-form-urlencoded'
			}
		})
	},
	//查询购物车数据
	zimshopCart(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/findAllByUserId`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	//删除购物车数据
	delzimShopCart(params) {
		let param = qs.stringify(params)
		return axios.post(`${base.bd}/deleteById?${param}`)
	},
	//添加进购物车
	zimaddShopCart(params) {
		let param = qs.stringify(params)
		return axios.post(`${base.bd}/save?${param}`)
	},
	IdZimData(params){
		let param = qs.stringify(params)
		// let token = JSON.parse(sessionStorage.getItem('store')).accToken
		let token = localStorage.getItem('token')
		return axios.get(`${base.bd}/selfMedia/findResourceSelfMedia?${param}`,{headers:{"Authorization":token}})
	},
	// 自媒体资源结束=========================================================================================================================================

	wxArticle(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/publicNumber/findResourcePublicNumber?${param}`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	IdWxData(params){
		let param = qs.stringify(params)
		// let token = JSON.parse(sessionStorage.getItem('store')).accToken
		let token = localStorage.getItem('token')
		return axios.get(`${base.bd}/publicNumber/findResourcePublicNumber?${param}`,{headers:{"Authorization":token}})
	},
	// 微信资源结束=============================================================================================================================================

	wbArticle(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/weibo/findResourceWeibo?${param}`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	IdWbData(params){
		let param = qs.stringify(params)
		// let token = JSON.parse(sessionStorage.getItem('store')).accToken
		let token = localStorage.getItem('token')
		return axios.get(`${base.bd}/weibo/findResourceWeibo?${param}`,{headers:{"Authorization":token}})
	},
	// 微博资源结束=========================================================================================================================================
	videoArticle(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/vedio/findResourceVedio?${param}`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	IdVideoData(params){
		let param = qs.stringify(params)
		// let token = JSON.parse(sessionStorage.getItem('store')).accToken
		let token = localStorage.getItem('token')
		return axios.get(`${base.bd}/vedio/findResourceVedio?${param}`,{headers:{"Authorization":token}})
	},
	// 视频资源结束=========================================================================================================================================
	redArticle(params) {
		let param = qs.stringify(params)
		return axios.get(`${base.bd}/smallRedBook/findSmallRedBook?${param}`)
		// return axios.get(`${base.bd}/common/findCitys`);
	},
	IdRedData(params){
		let param = qs.stringify(params)
		// let token = JSON.parse(sessionStorage.getItem('store')).accToken
		let token = localStorage.getItem('token')
		return axios.get(`${base.bd}/smallRedBook/findSmallRedBook?${param}`,{headers:{"Authorization":token}})
	},
	// 小红书资源结束=========================================================================================================================================
}

export default mediaMall;
